<template>
  <div class="app-container">
    <div class="filter-container">
        <!-- 搜索 -->
        <div class="fun-btn">
          <span>搜索：</span>
          <el-input
            placeholder="输入关键字"
            style="width: 200px;"
            class="filter-item"
            v-model="listQuery.title"
          />
          <el-button
            type="primary"
            icon="el-icon-search"
            class="search-bth"
            @click="handleFilter"
          >搜索</el-button>

          <el-button icon="el-icon-plus" class="minus search-bth" @click="addAccount">添加</el-button>
        </div>

        
    </div>
    <!-- 表格内容 -->
    <el-table
      :data="list"
      border
      style="width: 100%;margin-top:20px;">
      <el-table-column
        v-for="(item,index) in tableTitle"
        :key="index"
        :prop="item.prop"
        :label="item.label"
        sortable
      />
      <el-table-column
        prop="operate"
        label="操作"
        sortable
        width='150px'
      >
        <template slot-scope="scope">
          <el-button
            class="edit"
            size="mini"
            type="primary"
           >修改
          </el-button>
          <el-button
            class="edit"
            size="mini"
            type='danger'
            >删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      class="pages"
      background
      layout="prev, pager, next"
      :total="1000">
    </el-pagination>
    <!-- 添加弹出框 -->
    <el-dialog title="添加岗位" :visible.sync="dialogFormVisible">
        <el-form style="height:200px;overflow-y:scroll;">
            <el-form-item label="岗位" label-width="80px">
                <el-input v-model="form.post" autocomplete="off" class="form_width"></el-input>
            </el-form-item>
            <el-form-item label="说明" label-width="80px">
                <el-input v-model="form.accont" autocomplete="off" class="form_width"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
        </div>
    </el-dialog>
    
  </div>
</template>

<script>
export default {
  name: "ComplexTable",
  data() {
    return {
        listQuery: {
            title: ''
        },
        options: [{
          value: '选项1',
          label: '黄金糕'
        }, {
          value: '选项2',
          label: '双皮奶'
        }, {
          value: '选项3',
          label: '蚵仔煎'
        }, {
          value: '选项4',
          label: '龙须面'
        }, {
          value: '选项5',
          label: '北京烤鸭'
        }],
        value: '',
        form: {
            post: '',
            accont: '',
            name: '',
            tel: '',
            region: ''
        },
        value: true,
        list: [
            {
                id: 1,
                name: '管理员',
                des: '管理员账号'
            }
        ],
        tableTitle: [
            {
                label: 'id',
                prop: 'id'
            },
            {
                label: '岗位名称',
                prop: 'name'
            },
            {
                label: '说明',
                prop: 'des'
            }
        ],
        dialogFormVisible: false, // 添加弹框是否显示

    };
  },
  created() {
  },
  methods: {
      handleFilter (){

      },
      addAccount (){
          this.dialogFormVisible = true
      }
  }
};
</script>

<style scoped>
.search-bth {
  background: #009688;
  color: #ffffff;
  width: 65px;
  font-size: 14px;
  text-indent: -7px;
  margin-left: 24px;
}
.form_width{
  width: 95%;
}
.pages{
  margin-top: 10px;
}
</style>


